<template>
  <div>
    <el-card>
      <el-form ref="formRef" :inline="true" :model="form" class="demo-form-inline" :rules="formRules">
        <el-row>
          <el-col :span="6">
            <el-form-item prop="code">
              <p>仓库编号</p>
              <el-input v-model="form.code" placeholder="请输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item>
              <p>仓库名称</p>
              <el-input v-model="form.name" placeholder="请输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item>
              <p>仓库状态</p>
              <el-select v-model="form.status" placeholder="请输入">
                <el-option v-for="(item,index) in searchStatus" :key="index" :label="item.label" :value="item.value" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item>
              <p />
              <el-row>
                <el-button type="primary" round @click="onSubmit">查询</el-button>
                <el-button round type="info" @click="resect">重置</el-button>
              </el-row>
            </el-form-item>
          </el-col>
        </el-row>

      </el-form>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {
        code: '',
        name: '',
        status: ''
      },
      formRules: {
        code: [{ required: true, message: '请输入活动名称', trigger: 'blur' }]
      },
      searchStatus: [
        { value: 'unfined', label: '全部' },
        { value: '0', label: '停用' },
        { value: '1', label: '启用' }
      ]
    }
  },
  methods: {
    onSubmit() {
      this.$emit('submit', this.form)
    },
    resect() {
      this.form = {
        code: '',
        name: '',
        status: ''
      }
      this.$emit('submit', this.form)
    }
  }
}
</script>

<style lang="scss" scoped>
p{
  height: 40px;
  color: #887e7e;
}
::v-deep .el-input__inner{
 background-color: #f8f5f5;
}
::v-deep .is-always-shadow{
  padding: 10px 20px;
}
</style>
